package br.edu.ufcg.sig.query;

import java.io.Serializable;
import java.util.ArrayList;

public class QueryTable implements Serializable{
	
	private static final long serialVersionUID = -1323187922533189091L;
	
	private ArrayList<ColumnInfo> columns;
	private ArrayList<String[]> values;
	
	public QueryTable() {
		columns = new ArrayList<ColumnInfo>();
		values = new ArrayList<String[]>();
	}
	
	/**
	 * @return the columns
	 */
	public ArrayList<ColumnInfo> getColumns() {
		return columns;
	}

	/**
	 * @return the values
	 */
	public ArrayList<String[]> getValues() {
		return values;
	}

	public void setColumns(ArrayList<ColumnInfo> columns) {
		this.columns = columns;
	}

	public void setValues(ArrayList<String[]> values) {
		this.values = values;
	}
	
	public ArrayList<ColumnInfo> getColumnsWithTag(String tag) {
		ArrayList<ColumnInfo> tagColumns = new ArrayList<ColumnInfo>();
		for(ColumnInfo column: columns){
			if(column.getName().endsWith(tag)){
				tagColumns.add(column);
			}
		}
		return tagColumns;
	}

}
